package j05math;

import java.util.Date;

public class J2Date {
    public static void main(String[] args) {
        Date d1 = new Date();
        System.out.println("d1 = " + d1);
        //时间戳  1733 473791710
        System.out.println(d1.getTime());
        // 2022-12-23 11:44:55
        System.out.println(new Date(0));//

        Date d2 = new Date(d1.getTime()+24*7*3600*1000);
        System.out.println(d2);

        System.out.println("====");
        Date d11 = new Date(0);
        Date d22 = new Date(0);
        System.out.println(d11==d22);//false
        System.out.println(d11.equals(d22));

        d22.setTime(-1000000);
        System.out.println("d22 = " + d22);
    }
}
